<%= form_for([:admin,@tag],html:{class:'form-horizontal'}) do |f| %>
  <% if @tag.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(@tag.errors.count, "error") %> prohibited this tag from being saved:</h2>

      <ul>
      <% @tag.errors.full_messages.each do |message| %>
        <li><%= message %></li>
      <% end %>
      </ul>
    </div>
  <% end %>

    <h3><%= params[:action] == 'edit' ? '编辑标签信息' : '新建标签信息' %></h3>
    <hr>
    <div class="form-group">
      <label class="control-label col-md-2">标签名称</label>
      <div class="col-md-4">
        <%= f.text_field :name ,class:'form-control',placeholder:'请输入标签名称' %>
      </div>
    </div>

    <div class="form-group">
      <input type="submit" class=" col-md-offset-1 btn btn-primary col-md-2" value="提交" />
    </div>
<% end %>
